package com.zlz.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Document(indexName="es",type="book")
public class Book {
    @Id
    private Integer id;
    @Field(type=FieldType.Text,analyzer="ik_max_word")
    private String name;
    @Field(type=FieldType.Text,analyzer="ik_max_word")
    private String author;
    @Field(type=FieldType.Text,analyzer="ik_max_word")
    private String detail;
    @Field
    private Double price;
}
